!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){e.exports=n(3)},function(e,t){function n(e,t,n,r,i,o,a){try{var c=e[o](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,i)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(i,o){var a=e.apply(t,r);function c(e){n(a,i,o,c,s,"next",e)}function s(e){n(a,i,o,c,s,"throw",e)}c(void 0)}))}}},function(e,t,n){n(5),e.exports=n(4)},function(e,t,n){var r=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(e,t,n,r){var i=t&&t.prototype instanceof u?t:u,o=Object.create(i.prototype),a=new k(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return x()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var c=y(a,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l={};function u(){}function d(){}function p(){}var h={};h[i]=function(){return this};var f=Object.getPrototypeOf,m=f&&f(f(L([])));m&&m!==t&&n.call(m,i)&&(h=m);var v=p.prototype=u.prototype=Object.create(h);function g(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function _(e,t){var r;this._invoke=function(i,o){function a(){return new t((function(r,a){!function r(i,o,a,c){var l=s(e[i],e,o);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,c)}))}c(l.arg)}(i,o,r,a)}))}return r=r?r.then(a,a):a()}}function y(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,y(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function b(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function L(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;w(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:L(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r),o=n(1),a=n.n(o);var c,s={newsletter:"https://subscription.indianexpress.com/",auth:"https://authentication.indianexpress.com/",links:"https://media-central.indianexpress.com/static/subscription/",images:"https://media-central.indianexpress.com/static/subscription/",js:"https://media-central.indianexpress.com/static/subscription/"};try{c=window.self!==window.top}catch(e){c=!1}function l(e,t){window.sessionStorage.setItem(e,JSON.stringify(t))}function u(e){return window.sessionStorage.getItem(e)}function d(e){c&&(e=e+"-vendor"+nLvid);for(var t=e+"=",n=decodeURIComponent(document.cookie).split(";"),r=0;r0,g=window.location.href.indexOf("redirectFromPopup")>0,_=window.location.href.indexOf("nLEmailLinkClick")>0,y=document.querySelector("#id_newsletter_subscription"),b=document.querySelector("#id_newsletter_subscription_popup"),w=document.querySelector("#id_newsletter_detail_page"),k=[];try{e=nLvid}catch(t){e=void 0}try{t=window.self!==window.top}catch(e){t=!1}1==t&&(v=origin.indexOf("newsletterVerified")>0);var L="",x=!1,S="",E="";function T(e,n){window.ga&&ga.create?1==t?(console.log("in iframe/ga initiated"),ga("send","event",e,n,origin)):(console.log(" not in iframe/ga initiated"),ga("send","event",e,n,window.location.href)):console.log("ga not initiated")}function C(){u("onceRedirected")&&t&&N(!0),q((function(e){if(!u("onceRedirected")||"false"===u("onceRedirected"))if(t){var n=y;n.innerHTML="",n.appendChild(ee(!0)),se("thankyou_widget_newsletter_link")}else{var r=g?b:y,i=document.createElement("div");i.className="pop_up_box",i.innerHTML='\n
\n close icon\n
\n ');var o=i.querySelector(".pop_up_content"),a=i.querySelector(".close_icon");a&&a.addEventListener("click",(function(){M(!0,!0,g)})),o.appendChild(K(!0,!1,g)),!0,r.innerHTML="",r.appendChild(i),se("thankyou_widget_newsletter_link")}}))}function N(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=y,r=b;v&&!e&&C(),(n||r)&&B().then((function(){var i=u("newsLetterVendorsSectionData");if(n&&"true"===n.dataset.ispopup&&"true"!==n.dataset.bottom?x=!0:n&&"true"!==n.dataset.ispopup&&"true"===n.dataset.bottom&&!0,i){var o,a,c=A(i),s=n&&n.dataset.slug||"",l=r&&r.dataset.slug||"";r&&(a=O(c.results,l,!0),x=!0),n&&(o=O(c.results,s,!1)),(o||a)&&q((function(n){n?X(n).then((function(){var e=I(),n=I(!0);e||W(),t&&!v&&W(),n||W(!0),w&&!v&&W()})):(W(),W(!0)),e&&v&&W()}))}})).catch((function(e){return console.log("something went wrong in vendorConfig ",e)})),_&&T("Newsletter Page Link","Verification Email Link Click")}function q(e){return D.apply(this,arguments)}function D(){return(D=a()(i.a.mark((function t(r){var o;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=r||function(){},o="",d("ieCentralServicesToken")&&u("nLUserData")&&u("nLvendorConfigData")){t.next=7;break}return t.next=5,m("".concat(n,"api/vendor-config/?vendorId=").concat(e,"&includeVendorIdData=true")).then((function(e){l("nLvendorConfigData",e);var t=e.results||[],n=t[0]?t[0].vendorIdData:{};l("nlThemeColor",t[0].themeColor);var r=n.cookieVariableName,i=r?d(r):"";if(i)return V(i)})).then((function(){o=d("nLEmail"),v&&!o&&(o=atob(te("email",window.location.href))),r(o)}));case 5:t.next=10;break;case 7:o=d("nLEmail"),v&&!o&&(o=atob(te("email",window.location.href))),r(o);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function I(e){var t=e?"_popup":"",n=A(u("userSubscribedNewsLetter")||""),r=A(u("slugToSectionNewsletter"+t)||"")||[],i=n.results,o=!1;return n&&r.length&&r.map((function(e){i.map((function(t){t.newsletterData.id===e.id&&(o=!0)}))})),o}function P(e){var t=u("nLvendorConfigData");if(t){var n=A(t).results||[];return(n[0]?n[0]:{})[e]||""}return""}function j(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=document.createElement("div");t.className="pop_up_box",t.innerHTML='\n
\n \n
\n ');var n=t.querySelector(".pop_up_content"),r=t.querySelector(".close_icon");return r&&r.addEventListener("click",(function(t){t.preventDefault(),M(!0,!0,e)})),n&&n.appendChild(F(e)),t}function M(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];l("showNewsLetterSubscription",!1),p("showNlPopup",!1,1/24);var r=P("popupHideDuration")||15;n&&!v&&p("nLPopupSuppressed",!0,r),t&&p("isNlPopUpActive",!1,15);var i=n?b:y;i&&(i.innerHTML=""),e&&T("Newsletter Subscription Popup","Dismissed")}function O(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[];(e=e||[]).map((function(e){e.vendorSectionData.slug===t&&e.isPrimary&&r.push(e)})),r.length||e.map((function(e){"default"===e.vendorSectionData.slug&&e.isPrimary&&r.push(e)})),n?E=r.length?r[0].tagLine:"":S=r.length?r[0].tagLine:"";var i=n?"_popup":"";return l("slugToSectionNewsletter"+i,r),r.length>0}function A(e){try{return JSON.parse(e)}catch(t){return void console.log("Unable to parse json, ",e)}}function V(e){return H.apply(this,arguments)}function H(){return(H=a()(i.a.mark((function t(n){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=n||"",t.next=3,m("".concat(r,"api/vendor/").concat(e,"/oauth-user/?token=").concat(n)).then((function(e){p("ieCentralServicesToken",e.token,1),l("nLUserData",e),p("nLEmail",e.email,365)})).catch((function(e){return console.log("something went wrong with authentication ",e)}));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function B(){return R.apply(this,arguments)}function R(){return(R=a()(i.a.mark((function t(){var r;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=u("newsLetterVendorsSectionData"))){t.next=3;break}return t.abrupt("return",r);case 3:return t.next=5,m("".concat(n,"api/newsletter/?isPrimary=true&includeVendorSectionData=true&vendorId=").concat(e,"&active=true")).then((function(e){l("newsLetterVendorsSectionData",e)}));case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function U(){var e=document.createElement("div");return e.className="newsletter_section",e.appendChild(F()),e}function F(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=u("nLvendorConfigData"),n=A(t),r=n.results?n.results[0].widgetLogo:"",i=document.createElement("div");i.className="newsletter_form";var o=e?E:S;if(i.innerHTML='\n mail logo\n

').concat(o,"

\n \n "),w){var a=document.getElementById("detail_page_tag_line")?document.getElementById("detail_page_tag_line"):document.createElement("div");a.setAttribute("id","detail_page_tag_line"),a.innerHTML='"),w.insertBefore(a,w.firstChild),i.innerHTML=""}return i.appendChild(Y(e)),i}function Y(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=document.createElement("form"),r=d("nLEmail")||"",i=(P("landingURL"),"");e&&(i="_popup"),1==t&&(r=""),n.setAttribute("data-frompopupcontainer",e);var o=null;return o=(o=e?b?b.getAttribute("data-lang"):"":y?y.getAttribute("data-lang"):"")||"en",n.innerHTML="hi"==o?'
\n \n \n '):"mr"==o?'
\n \n \n '):'
\n \n \n '),n.addEventListener("submit",(function(t){t.preventDefault(),J(e)})),n}function G(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t?"_popup":"",r=u("slugToSectionNewsletter"+n),i=A(r),o=[];return i.map((function(e){o.push(e.id)})),o}function W(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=P("popupShowTimeout")||1e4,n=x?t:0,r=y,i=b;setTimeout((function(){null==i||d("nLPopupSuppressed")||!e||v||(i.appendChild(j(!0)),!0),se("email_form_newsletter_link")}),n),y&&!e&&(r.innerHTML="",r.appendChild(U()),!0)}function J(r){var i=r?"_popup":"",o=document.getElementById("id_newsletter_subscription"+i);console.log("subscribeCurrentNewsLetter elementIdSuffix",i);o.querySelector(".pop_up_box");var a=o?o.dataset.slug:"",s=o.querySelector("#id_subscriber_email"+i).value,l=r?G(a,!0).slice():G(a).slice(),u=o.querySelector(".error_msg");if(h(s)){if(u.innerText="",l.length&&s){var d=window.location.href.replace("#amp=1","");1==t&&(d=origin),d.indexOf("?")>0?d+="&newsletterVerified=true":d+="?newsletterVerified=true",r&&(d+="&redirectFromPopup="+r);var m={email:s,newsletterIds:l.slice(),vendorId:e,sourceURL:d};f("".concat(n,"api/subscription/"),m).then((function(e){var n=e.length?e[0]:{isVerified:!0},i=!e.length;if(r){T("Newsletter Subscription Popup","Email Submit");var a=o.querySelector(".pop_up_content");a.innerHTML='close icon'),a.appendChild(K(n.isVerified,i)),!0,o.querySelector(".pop_up_content .close_icon").addEventListener("click",(function(e){M(!0,!1,!0)}))}else T("Newsletter Subscription Widget","Email Submit"),o.innerHTML="",o.appendChild(ee(n.isVerified,i)),se("thankyou_widget_newsletter_link");return 1==t&&(o.innerHTML="",o.appendChild(ee(n.isVerified,i)),se("thankyou_widget_newsletter_link")),L=s,p("nLEmail",s,365),X(s)}))}}else u.innerText="Please enter a valid email address."}function z(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=P("landingURL"),i=null;return"hi"==(i=(i=n?b?b.getAttribute("data-lang"):"":y?y.getAttribute("data-lang"):"")||"en")?' success icon\n

').concat(v?"धन्‍यवाद! आपने सफलतापूर्वक सब्‍स्‍क्राइब कर लिया है।":t?"आप पहले से ही इस न्यूजलेटर को सब्‍स्‍क्राइब कर चुके हैं।":"सब्‍स्‍क्राइब करने के लिए धन्‍यवाद!",'

\n

').concat(e?"":"हमने आपको वेरिफिकेशन ईमेल भेजा है। कृपया इनबॉक्‍स देखें। ",'

\n \n '):"mr"==i?' success icon\n

').concat(v?"धन्यवाद, तुम्ही लोकसत्ताचे दैनंदिन न्यूजलेटर यशस्वीरित्या सबस्क्राइब केले आहे!":t?"तुम्ही या न्यूजलेटरसाठी अगोदरच सबस्क्राइब केलेलं आहे!":"सबस्क्राइब करण्यासाठी धन्यवाद!",'

\n

').concat(e?"":"व्हेरिफिकेशनसाठी इमेल पाठवला आहे, कृपया इनबॉक्स चेक करा!",'

\n \n '):' success icon\n

').concat(v?"Your email has been successfully verified. Thanks for subscribing.":t?"You are already subscribed to this newsletter.":"Thank you for subscribing.",'

\n

').concat(e?"":"We have sent you a verification email, please check your inbox.",'

\n \n ')}function K(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=document.createElement("div");return r.className="verification_box",r.innerHTML=z(e,t,n),v?(l("onceRedirected",!0),setTimeout(T,2e3,"Newsletter Subscription Popup","Email Verified")):r.appendChild(Q()),r}function $(){T("Newsletter Subscription Popup","Tags Submit");var r=this.closest(".related_newsletter").querySelector(".tag_box").querySelectorAll(".active-tag"),i=[];r.forEach((function(e){i.push(e.dataset.id)}));window.location.href.search("\\?");var o={vendorId:e,topicIds:i,email:L,sourceURL:t?origin:window.location.href+"?newsletterVerified=true"};i.length&&f("".concat(n,"api/topic-interest/?vendorId=").concat(e),o).then((function(e){e.length&&M(!1,!1,!0)}))}function Q(){var t=document.createElement("div");t.className="related_newsletter",t.innerHTML='

Which other newsletters do you wish to subscribe to?

';var r=document.createElement("button"),i=b.dataset.slug;r.className="btn_done",r.addEventListener("click",$),r.innerText="Done";var o=document.createElement("ul");return o.className="tag_box",t.style.display="none",m("".concat(n,"api/vendor-topic/?vendorId=").concat(e,"&active=true&exSlug=").concat(i)).then((function(e){e.results&&(e.results.length&&(t.style.display="block"),e.results.map((function(e){var t=document.createElement("li");t.innerHTML=" \n ').concat(e.name," \n "),t.addEventListener("click",(function(){this.classList.contains("active-tag")?(this.classList.remove("active-tag"),this.style.backgroundColor=""):(this.classList.add("active-tag"),this.style.backgroundColor=A(u("nlThemeColor")));var e=this.querySelector("img"),t=e.src;e.src=e.dataset.light,e.dataset.light=t,o.querySelector(".active-tag")?r.style.backgroundColor=A(u("nlThemeColor")):r.style.backgroundColor="#dadada"})),t.dataset.id=e.id,o.appendChild(t)})))})),t.appendChild(o),t.appendChild(r),t}function X(e){return Z.apply(this,arguments)}function Z(){return(Z=a()(i.a.mark((function t(r){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,m("".concat(n,"api/subscription/?email=").concat(r,"&vendorId=").concat(e,"&includeNewsletterData=true&isVerified=true")).then((function(e){l("userSubscribedNewsLetter",e)})).catch((function(e){return console.log(e)}));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ee(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=document.createElement("div");return i.className="thanks_subscribing",1==t&&i.classList.add("thanks_subscribing","thanks_subscribing_iframe"),i.innerHTML=z(e,n,r),v&&(l("onceRedirected",!0),setTimeout(T,2e3,"Newsletter Subscription Widget","Email Verified")),i}function te(e,t){t||(t=location.href),e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null==n?null:n[1]}function ne(t){m("".concat(n,"api/newsletter/?active=true&includeVendorSectionData=true&vendorId=").concat(e,"&email=").concat(t)).then((function(e){l("newsLetterVendorsSectionData",e);var t=e,n=document.querySelector("#id_newsletter_subscription_page");if(e&&n){var r,i=A(u("nLvendorConfigData")).results||[];r=i[0].pageHeading?i[0].pageHeading:"Subscribe and stay updated with the latest reportage, insightful commentary and in-depth analyses, delivered to your inbox",n.innerHTML='\n \n ");var o=n.querySelector(".newsletter_content_box");v&&o.appendChild(re()),o.appendChild(function(){var e=d("nLEmail")||"",t=document.createElement("div");return t.className="newsletter_block",t.innerHTML='\n
\n \n
\n
\n
\n
\n \n \n \n \n
\n
\n '),t.querySelector(".select_allcheck").addEventListener("click",ae),t.querySelector("form").addEventListener("submit",ce),t}()),o.appendChild(ie(t.results))}}))}function re(e){var n=document.getElementById("thanks_subscribing");n&&n.remove();var r=document.createElement("div");r.className="thanks_subscribing",1==t&&r.classList.add("thanks_subscribing","thanks_subscribing_iframe"),r.id="thanks_subscribing";var i="We have sent you a verification email, please check your inbox.",o=document.getElementById("page-email-inp")?document.getElementById("page-email-inp").value:"";if(v&&!e&&(i=""),function(){var e=u("nLvendorConfigData");if(e){var t=A(e).results||[];return d((t[0]?t[0].vendorIdData:{}).cookieVariableName)}return!1}()){var a=u("nLUserData")?u("nLUserData").email:"";a&&a==o&&(i="")}if(r.innerHTML='\n success icon\n

').concat(!v||e?"Thank you for subscribing.":"Your email has been successfully verified. Thanks for subscribing.","

\n

").concat(i,"

\n "),v){for(var s=A(u("newsLetterVendorsSectionData")),l=0;l")),n.innerHTML="\n ".concat(r,'\n \n

').concat(e.name,"

\n

").concat(e.desc,"

\n "),n.className=e.isSubscribed?"active_addon_box":"",n.querySelector('input[type="checkbox"]').checked=e.isSubscribed,n.querySelector('input[type="checkbox"]').disabled=e.isSubscribed,t.appendChild(n),n.querySelector(".label_container").addEventListener("click",oe)})),t}function oe(){var e=this.closest("li");e.querySelector('input[type="checkbox"]').checked?e.classList.add("active_addon_box"):e.classList.remove("active_addon_box")}function ae(){var e=this.closest(".select_allcheck"),t=document.getElementById("select-all-cbox"),n=e.closest(".newsletter_content_box").querySelector(".newslatter_addon_box");t.checked=1!=t.checked,t.checked?e.classList.add("active_addon_box"):e.classList.remove("active_addon_box"),n.querySelectorAll(".label_container").forEach((function(e){e.querySelectorAll("input").forEach((function(e){e.disabled||(e.checked=!t.checked,e.click())}))}))}function ce(r){r.preventDefault();var i,o,a=this.querySelector('input[type="email"]').value,c=document.querySelector(".newsletter_content_box"),s=(i=document.querySelector(".newsletter_content_box").querySelector(".newslatter_addon_box"),o=[],k=[],i.querySelectorAll("li.active_addon_box").forEach((function(e){o.push(e.dataset.id),k.push(e.dataset.name)})),o).slice(),l=this.querySelector(".error_msg");if(h(a))if(s.length){if(l.innerText="",a&&s.length){var u=-1==window.location.href.search("\\?")?"?":"&",d={email:a,newsletterIds:s,vendorId:e,sourceURL:t?origin:window.location.href+u+"newsletterVerified=true&email="+btoa(a)};f("".concat(n,"api/subscription/"),d).then((function(e){var t=c.querySelector(".newsletter_block");if(e.length&&!e[0].isVerified)c.insertBefore(re(!0),t);else{var n=re();n.querySelector("p").innerHTML="",e.length||(n.querySelector(".nl_thanks_heading").innerHTML="You are already subscribed to selected newsletters."),c.insertBefore(n,t)}document.getElementById("thanks_subscribing").scrollIntoView()}))}window.ga&&ga.create&&ga("send","event","Newsletter Subscription Page","Email Submit",k.join("/"))}else l.innerText="Please select atleast 1 newsletter.";else l.innerText="Please enter a valid email address."}function se(e){if(P("landingURLActive")){var t={email_form_newsletter_link:["Newsletter Page Link","Email Form Click"],thankyou_widget_newsletter_link:["Newsletter Page Link","Thank You Widget Click"]},n=document.getElementById(e);if(n)document.getElementById(e+"_anchor").addEventListener("click",(function(n){var r,i,o;n.preventDefault(),r=this.getAttribute("data-href"),i=t[e][0],o=t[e][1],T(i,o),window.open(r,"_blank")}),!1),n.style.display="block";else console.log("Unable to find id, ",e)}}function le(){return(le=a()(i.a.mark((function e(){var t,n,r,o;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=document.createElement("div")).setAttribute("id","id_newsletter_subscription"),w.appendChild(t),w.dataset.lang&&(t.dataset.lang=w.dataset.lang),!w.dataset.slug||(t.dataset.slug=w.dataset.slug),t.dataset.bottom="true",y=t,q(ne),(n=document.createElement("div")).setAttribute("id","newsletter_content_box"),w.appendChild(n),e.next=13,B();case 13:r=u("newsLetterVendorsSectionData"),o=A(r),n.appendChild(ie(o.results)),ue(o.results),de(),pe();case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ue(e){e=e||[];var t=document.createElement("div"),n=w.dataset.slug,r=null;e.map((function(e){e.vendorSectionData.slug===n&&e.isPrimary&&(r=e.longDesc)})),t.innerText=r||"I am long Description";var i=document.querySelector(".newslatter_addon_box");i.parentNode.insertBefore(t,i);var o=document.createElement("p");o.setAttribute("class","other_newsletter_boxes_heading");var a,c,s;a=A(u("nLvendorConfigData")).results[0].vendorIdData.name,o.innerText="Other Newsletters by "+a,c=o,(s=t).parentNode.insertBefore(c,s.nextSibling)}function de(){for(var e=document.getElementsByClassName("checkmark_box"),t=0;t5&&e.removeChild(e.childNodes[r]),n++;var i=document.createElement("li");i.setAttribute("class","know_more"),e.appendChild(i);var o=document.createElement("span");o.innerText="Know More ";var a=document.createElement("img");a.src="".concat(c,"images/read-more-arrow.svg"),i.appendChild(o),o.appendChild(a);var s=P("landingURL");o.addEventListener("click",(function(e){e.preventDefault(),window.open(s,"_blank")}))}Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}),function(e,t){var n=document.head,r=document.body.getElementsByTagName("footer")[0],i=document.createElement("link");i.rel="stylesheet",i.href=e,"footer"===t?r.appendChild(i):n.appendChild(i)}("".concat(o,"css/newsletter.css")),w&&function(){le.apply(this,arguments)}(),y||b?N():q(ne)}()}]); //# sourceMappingURL=newsletter.js.map